{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style type="text/css">
    #des,#des input{ width: 40px;text-align:center;}
    #id{ width: 78px; }
    .bs-checkbox{ width: 36px; height: 40px }
    .fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
    #title span{ float: right; margin-left: 3.333px;}
    .search{ margin-bottom: 0px !important; }
    .asdlkjasd{ background: #1ab394; color: #fff}
    #title{ position: relative;padding-right: 50px;}
    #title span{position: absolute;top: 12px;right: 10px;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar" style="display:inline-block; margin-right:100px">
                        <a class="btn btn-default btn-outline {present name='status'}{else /}asdlkjasd{/present}" href="{:url('distribution')}">全部</a>
                        <a class="btn btn-default btn-outline {present name='status'}{eq name='status' value='0'}asdlkjasd{/eq}{/present}" href="{:url('distribution',['status'=>'0'])}">待结算</a>
                        <a class="btn btn-default btn-outline {present name='status'}{eq name='status' value='1'}asdlkjasd{/eq}{/present}" href="{:url('distribution',['status'=>'1'])}">已结算</a>
                        <a class="btn btn-default btn-outline {present name='status'}{eq name='status' value='-1'}asdlkjasd{/eq}{/present}" href="{:url('distribution',['status'=>'-1'])}">已失效</a>
                    </div>
                    <div class="fixed-table-toolbar">
                        <form  method="get" action="">
                            <div class="pull-left search">
                                <div class="columns columns-right btn-group pull-left" >
                                    <select class="form-control" name="type">
                                        <option value="order_id">订单ID</option>
                                        <option value="uid">用户id</option>
                                    </select>
                                </div>
                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('distribution')}">返回订单管理</a>
                                </div>{php}
                                }
                                {/php}
                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" id="filter" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }

                                    }
                                    {/php}
                                    name="name" placeholder="">
                                </div>


                            </div>
                        </form>
                    </div>


                    <div style="display:block;clear: both;"></div>




                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center" data-width="2%">ID</th>
                                    <th data-align="center" data-width="2%">下单用户ID</th>
                                    <th data-align="center" data-width="3%">订单ID</th>
                                    <th data-align="center" data-width="10%">订单总价(积分)</th>
                                    <th data-align="center" data-width="10%">一级上级</th>
                                    <th data-align="center" data-width="10%">二级上级</th>
                                    <th data-align="center" data-width="10%">三级上级</th>
                                    <th data-align="center" data-width="10%">创建时间</th>
                                    <th data-align="center" data-width="10%">修改时间</th>
                                    <th data-align="center" data-width="2%">订单状态</th>
                                    <th data-align="center" data-width="2%">管理</th>
                                </tr>
                                </thead>
                                <tbody id="form">
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td>
                                        <a onclick="member('{$v.user_id}')" style="color:#40BCF7">{$v.username2??''}<br />({$v.user_id})</a>
                                    </td>
                                    <td>{$v.order_id}</td>
                                    <td>{$v.totalprice}</td>
                                    <td>
                                        {if condition="$v.one_uid"}
                                        <a onclick="member('{$v.one_uid}')" style="color:#40BCF7">{$v.username3??''}({$v.one_uid})</a><br />
                                        佣金{$v.one_commission} 比例{$v.one_rate * 100}%
                                        {/if}
                                    </td>
                                    <td>
                                        {if condition="$v.two_uid"}
                                        <a onclick="member('{$v.two_uid}')" style="color:#40BCF7">{$v.username4??''}({$v.two_uid})</a><br />
                                        佣金{$v.two_commission} 比例{$v.two_rate * 100}%
                                        {/if}
                                    </td>
                                    <td>
                                        {if condition="$v.three_uid"}
                                        <a onclick="member('{$v.three_uid}')" style="color:#40BCF7">{$v.username5??''}({$v.three_uid})</a><br />
                                        佣金{$v.three_commission} 比例{$v.three_rate * 100}%
                                        {/if}
                                    </td>
                                    <td><span {php}if(date('Ymd')==date('Ymd',$v['create_time']))echo 'style="color: #ed5565"';{/php}>{$v.create_time|date='Y-m-d H:i:s',###}</span></td>
                                    <td>
                                        {neq name="v.update_time" value="0"}
                                        <span {php}if(date('Ymd')==date('Ymd',$v['update_time']))echo 'style="color: #ed5565"';{/php}>{$v.update_time|date='Y-m-d H:i:s',###}</span>
                                        {/neq}
                                    </td>
                                    <td>
                                        {switch name="v.status"}
                                            {case value="-1"}<span class='btn btn-default btn-xs'>失&nbsp;&nbsp;&nbsp;败</span>{/case}
                                            {case value="0"}<span class='btn btn-danger btn-xs'>待结算</span>{/case}
                                            {case value="1"}<span class='btn btn-primary btn-xs'>已结算</span>{/case}
                                        {/switch}
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onclick="add('{:url('dingdanCode',['id'=>$v['order_id'],'url'=>-1])}')">订单详细</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{load href="__PLUGINS__layui/layui.js"}
{load href="__PLUGINS__layui/css/layui.css"}
{include file="public/footer" /}
<script type="text/javascript">
    $(document).ready(function(){

    });
    function xiang(id) {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'消息记录',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("xiangqing")}?id='+id
        });


        });
    }

    function member(id)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("member/index")}?search=id&name='+id
            });
        });
    }

</script>
 